package com.banshou.installs.utils;

import android.app.Dialog;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;

import com.banshou.installs.R;
import com.banshou.installs.constant.BaseApplication;
import com.zyao89.view.zloading.ZLoadingDialog;
import com.zyao89.view.zloading.Z_TYPE;

/**
 * Created by cjq on 2018/1/3.
 * Email: stoic_yb@139.com
 * features:
 */

public class DialogUtils {
    private ZLoadingDialog dialogAni;

    //    开启动画弹窗
    public void showAni(Context context) {
        if (dialogAni == null) {
            dialogAni = new ZLoadingDialog(context);
        }
        dialogAni.setLoadingBuilder(Z_TYPE.STAR_LOADING)//设置类型
                .setCanceledOnTouchOutside(false)
                .setLoadingColor(context.getResources().getColor(R.color.color_login_button))//颜色
                .setHintText("Loading...")
                .setHintTextSize(16) // 设置字体大小 dp
                .setHintTextColor(context.getResources().getColor(R.color.color_login_button))  // 设置字体颜色
                .show();
    }

    //    取消动画弹窗
    public void hideAni() {
        if (dialogAni != null) {
            dialogAni.cancel();
        }
    }
}
